package org.csmzxy.class2333;
class Animal{
    public void speak(){
        System.out.println("动物发出叫声");
    }
}
//狗类
class Dog extends Animal{
    public void speak(){
        System.out.println("狗发出汪汪的叫声");
    }
}
class Cat extends  Animal{
    public void speak(){
        System.out.println("猫发出喵喵的叫声");
    }
}
public class Example02 {
    public static void main(String[]args){
        Animal animal = new Animal();
        animal.speak();
        Dog dog = new Dog();
        dog.speak();
        Cat cat = new Cat();
        cat.speak();
    }
}
